package demo.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import demo.entity.users;
import demo.mappers.userRowMapper;

@Service
public class UserDao {
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	public users findUserById(int emp_id) {
		String sql = "SELECT * FROM USERS WHERE emp_id = ?";
		users user = jdbcTemplate.queryForObject(sql, new userRowMapper(),emp_id);
		return user;
		
	}
}
